MCQ Answer

Fill in the line of the following Python code for calculating the factorial of a number.

def fact(num):      if num == 0:           return 1      else:          return _____________________

Fill in the line of the following Python code for calculating the factorial of a number.

def fact(num):      if num == 0:           return 1      else:          return _____________________


किसी नंबर के फ़ैक्टोरियल की कॅल्क्युलेटिंग के लिए निम्नलिखित Python कोड की लाइन भरें।
Topic : Functions in Python

A. num*fact(num-1)

B. (num-1)*(num-2)

C. num*(num-1)

D. fact(num)*fact(num-1)




Correct Answer is :

A. num*fact(num-1)



Explanation
Suppose n=5 then, 5*4*3*2*1 is returned which is the factorial of 5.
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz